<?php

class Error
{
	private $_error = array();
	
	function Error()
	{
	}
	
	public function add($error, $message = null)
	{
		$this->_error[$error] = $message;
	}
	
	public function addErrors(array $errors)
	{
		foreach($errors AS $error)
		{
			$this->_error[$error] = $error;
		}
	}
	
	public function hasError()
	{
		return (!empty($this->_error));
	}
	
	public function printError()
	{
		require_once(BASE_PATH . "include/layout/formerror.php");
	}
}

?>